|
JIRA 4.4 : Running SQL commands in a HSQL database
This page last changed on Apr 09, 2011 by mdoar.
On rare occasions, one may wish to run raw SQL queries on a JIRA or Confluence database. This page describes how to obtain a SQL console for hsqldb databases, which JIRA and Confluence Standalone editions use by default. Locate the hsqldb directoryhsql stores its database in text files on the filesystem. Typically these will be in a database directory in the JIRA/Confluence root: [atlassian-jira-professional-3.4.2-standalone ~]$ ls -l database/ total 108 -rw-r--r-- 1 jturner jturner 0 Jul 28 09:12 jiradb.data -rw-r--r-- 1 jturner jturner 343 Jul 28 09:12 jiradb.properties -rw-r--r-- 1 jturner jturner 72272 Jul 28 10:02 jiradb.script [atlassian-jira-professional-3.4.2-standalone ~]$ In JIRA, the path is specified in conf/server.xml as '${catalina.home}/database/jiradb', where ${catalina.home} will be the directory atlassian-jira-professional-3.4.2-standalone in this instance. Locate the hsqldb jarThe hsqldb binary is usually located in the lib directory: [atlassian-jira-professional-3.4.2-standalone ~]$ ls lib/hsql* lib/hsqldb-1.8.0.5.jar Shut down JIRA/ConfluenceIf you haven't already, shut down any apps using the database. Run the consoleRun the following command (JIRA 4.0+): java -cp lib/hsqldb-1.8.0.5.jar org.hsqldb.util.DatabaseManager -user sa -url jdbc:hsqldb:database/jiradb In versions of JIRA before JIRA 4.1 the jar file was in common/lib This is for JIRA 3.6.5 and earlier: java -cp common/lib/hsqldb-1.7.1-patched.jar org.hsqldb.util.DatabaseManager -user sa -url jdbc:hsqldb:database/jiradb
Once you have finished running SQL queries, shut down the console before starting JIRA/Confluence. |
| Document generated by Confluence on Aug 18, 2011 23:28 |